<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    var bian = (function () {
        function Tank() {
            this.data = 3
            this.color = ""
            this.tan = () => { }
        }
        let index = null
        return {
            hanshu() {
                if (index) {
                    console.log('aa');
                    return index
                } else {
                    console.log('bb');
                    return index = new Tank()
                }
                // return index? index : index = new Tank()
            }
        }
    })()
    var a = bian.hanshu()
    var b = bian.hanshu()
    var c = bian.hanshu()
    // console.log(a);
</script>